<!--
 * @Descripttion: 
 * @version: 
 * @Author: wutao
 * @LastEditors: wutao
 * @LastEditTime: 2025-09-18 22:04:11
-->
<template>
  <div>
    <!-- <div class="top_hytitle" style="margin-top: 0;">
            <div class="letf_line"></div>
            <div class="center_text">欢迎回来</div>
            <div class="right_line"></div>
          </div> -->
    <div class="">
      <p style="margin: 15px 0; color: #9998a9">
        {{ formatTimestamp(topList.createTime) }}
      </p>

      <div class="top-box" :class="isShadow?'boxShadow':''">
         <img src="../../assets/iconIndex/jjrlc_logo.png" class="jjrlc_logo" alt="">
        <!-- <p>{{ topList.title }}</p> -->
        <div></div>
        <div
          class="top-box-list"
          style="
            border: 1px solid rgba(8, 131, 241, 0.08);
            background: linear-gradient(180deg, rgba(8,131,241,0.028) 0%, rgba(8,131,241,0.012) 100%);
            position: relative;
          "
        >
          <div
            v-for="(topItemCard, topItemIndex) in topList.card"
            class="top-box-list-item top-box-list-item-border"
            :key="topItemIndex"
          >
            <p class="ztfx-span" style="margin-bottom: 0px;">
              <!-- {{ topItemCard.sub }} -->
<template>
  <span>
    现在操作国债逆回购，计息天数将覆盖整个假期，实现
    <!-- {{ topItemCard.sub.split("“")[0] }} -->
    <strong>“资金占用时间短，享受收益天数多”</strong>
    <!-- {{ topItemCard.sub.split("”")[1] }} -->
  </span>
</template>





            </p>
          </div>
          <!-- <div
            class="guoqing"
            v-for="(topItemname, topnameIndex) in topList.card"
            :key="'list1-' + topnameIndex"
          >
            {{ topItemname.name }}
          </div> -->
        </div>
        <div
          class="gzlc_box"
          v-for="(item, index) in topList.linkUrl"
          :key="'list2-' + index"
          @click="gotodetails(item)"
        >
          <img src="../../assets/images/gzlc_icon.png" alt="" />
          <p>{{ item.name }}</p>
        </div>
        <p class="askMe">你可以尝试这样问我</p>
        <div
          @click="sendMessageBy(topItemLink)"
          v-for="(topItemLink, topItemLinkIndex) in topList.link"
          class="top-box-list-item-link"
          :key="topItemLinkIndex"
        >
          {{ topItemLink }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {} from "@/utils/common";
import { Toast } from "vant";
import commonFunc from "@/utils/ysjh";
export default {
  data() {
    return {};
  },
  props: {
    topList: {
      type: Object,
      default: () => {},
    },isShadow: {
    type: Boolean,
    default: false,
  },
  },
  watch: {},
  mounted() {},
  created() {},
  methods: {
    gotodetails(item) {
      console.log(item.url, "item");
      const { openSource, openType, functionCode, param } = item.url;
      commonFunc.openService(openSource, openType, functionCode, param);
    },
    sendMessageBy(e) {
      this.$parent.showCollect = false;
      this.$parent.someMethod(e);
    },

    formatTimestamp(ms) {
      if (!ms) {
        return "";
      }
      const time = Number(ms);
      if (!time || isNaN(time)) return "-";
      const d = new Date(time);
      const Y = d.getFullYear();
      const M = String(d.getMonth() + 1).padStart(2, "0");
      const D = String(d.getDate()).padStart(2, "0");
      const h = String(d.getHours()).padStart(2, "0");
      const m = String(d.getMinutes()).padStart(2, "0");
      const s = String(d.getSeconds()).padStart(2, "0");
      return `${Y}-${M}-${D} ${h}:${m}:${s}`;
    },
  },
};
</script>

<style lang="less" scoped>
.ztfx-span {
  opacity: 1;
  color: #333333 !important;
  font-family: PingFang SC;
  font-weight: regular;
  font-size: 16px;
  line-height: 26px;
  letter-spacing: 0px;
  background: none !important;
  font-weight: normal !important;
  text-align: justify; /* 整体文字两端对齐（多行时每行左右对齐） */
  text-align-last: left; /* 最后一行不满时，强制靠左对齐 */
}

.top-box-list-item-border {
  // border-bottom: 1px solid #aecde8;
}

.gzlc_box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 97px;
  height: 36px;
  background: url("@/assets/images/gzlc_box.png") no-repeat center center;
  background-size: 100% 100%;
  margin-top: 15px;
  font-size: 13px;
  font-family: PingFang SC-Medium, PingFang SC;
  font-weight: 500;
  color: #333333;

  img {
    width: 16px;
    height: 16px;
    margin-right: 2px;
    vertical-align: middle;
  }
}
.guoqing {
  position: absolute;
  top: -20px;
  left: 0;
  background: url("@/assets/iconIndex/guoqing.png") no-repeat center center;
  width: 146px;
  height: 39px;
  background-size: 146px 39px;
  color: white;
  padding-top: 5px;
  box-sizing: border-box;
  font-size: 15px;
  text-align: center;
  font-style: italic;
}

.ztfx-span-style {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* 上对齐，避免多行时错位 */
}

.ztfx-span-style strong {
  font-weight: bold;
  white-space: nowrap; /* 不换行 */
}

.ztfx-span-style span {
  flex: 1; /* 占满剩余空间 */
  margin-left: 10px; /* 和左边留点间距 */
  text-align: left; /* 文字靠左展示，避免被挤压 */
  word-break: break-all; /* 允许在任意字符处换行 */
  overflow-wrap: anywhere; /* 现代浏览器强制自动换行 */
}
.jjrlc_logo{
  width: 309px;
  height: 23px;
}
</style>